package com.imooc.infra.repository.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.imooc.infra.repository.entity.TDataCenterRule;

import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author 18870
 * @since 2023-05-27
 */
public interface ITDataCenterRuleService extends IService<TDataCenterRule> {

    TDataCenterRule getByBusinessIdAndRuleType(String businessId, String ruleType);

    List<String> listBusinessIds();

    default TDataCenterRule defaultGetOne(LambdaQueryWrapper<TDataCenterRule> wrapper) {
        wrapper.last("limit 1");
        return getOne(wrapper);
    }

    List<TDataCenterRule> listAll();
}
